package compoundDB.database;

/**
 * This class keeps track of configuration settings used within the database
 * package.
 * 
 * @author Kohl Bromwich
 */
public final class DBConfig
{
	// Load settings
	/**
	 * String used to load the database library.
	 */
	private static String databaseLoadUrl = "com.mysql.jdbc.Driver";
	// private static String DatabaseLoadUrl = "org.postgresql.Driver";
	
	// Connection Settings
	/**
	 * String used to specify type of connection.
	 */
	private static String connectUrl = "jdbc:mysql:";
	/**
	 * Port to connect to the database on.
	 */
	private static String connectPort = "3306";
	// private static String ConnectUrl = "jdbc:postgresql:";
	// private static String ConnectPort = "5432";
	/**
	 * IPAddress to connect to teh database at.
	 */
	private static String connectHost = "localhost";
	/**
	 * Database to connect to.
	 */
	private static String compoundDatabase = "compounddb";
	/**
	 * Password for the database.
	 */
	private static String password = "root";
	/**
	 * Username for the database.
	 */
	private static String user = "root";
	
	// Database table names
	/**
	 * Table in the database containing compound information.
	 */
	private static String compoundsTable = "compounds";
	/**
	 * Table in the database containing names for compounds.
	 */
	private static String compoundNamesTable = "compound_names";
	/**
	 * Table in the database containing user information.
	 */
	private static String usersTable = "users";
	
	// Database constants
	/**
	 * The number of default columns in the database that can't be removed or
	 * renamed.
	 */
	private static final int numberOfDefaultColumns = 7;
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getCompoundDatabase()
	{
		return compoundDatabase;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getCompoundNamesTable()
	{
		return compoundNamesTable;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getCompoundsTable()
	{
		return compoundsTable;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getConnectHost()
	{
		return connectHost;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getConnectPort()
	{
		return connectPort;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getConnectUrl()
	{
		return connectUrl;
	}
	
	// Getters
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getDatabaseLoadUrl()
	{
		return databaseLoadUrl;
	}
	
	/**
	 * Gets the number of default columns in teh database.
	 * 
	 * @return The number of default columns in the database.
	 */
	public static int getNumberOfDefaultColumns()
	{
		return numberOfDefaultColumns;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getPassword()
	{
		return password;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getUser()
	{
		return user;
	}
	
	/**
	 * Gets the specified config setting.
	 * 
	 * @return The specified string.
	 */
	public static String getUsersTable()
	{
		return usersTable;
	}
	
	// Setters
	/**
	 * Sets the specified config setting.
	 * 
	 * @param val
	 *            The string to set.
	 */
	public static void setCompoundDatabase(String val)
	{
		compoundDatabase = val;
	}
	
	// Constructor
	/**
	 * Empty constructor, since the values are all static.
	 */
	private DBConfig()
	{
		
	}
}
